package com.baijia.ticket;

/**
 * @title TicketException
 * @desc Ticket异常 
 * @author caoliang
 * @date 2015年12月5日
 * @version 1.0
 */
public abstract class TicketException extends Exception {

    private static final long serialVersionUID = -6000583436059919480L;

    private String code;

    public TicketException(final String code) {
        this.code = code;
    }

    public TicketException(final String code, final Throwable throwable) {
        super(throwable);
        this.code = code;
    }

    public final String getCode() {
        return (this.getCause() != null) ? this.getCause().toString()
            : this.code;
    }
}
